﻿<UserControl x:Class="AutomationMLMapper.Controls.DifferenceRoleClassListControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:MarkupExtensions="clr-namespace:AutomationMLMapper.Controls.MarkupExtensions"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:AutomationMLMapper.Controls"
			 xmlns:ConvertersAndTemplateSelectors="clr-namespace:AutomationMLMapper.Controls.ConvertersAndTemplateSelectors"
			 xmlns:Properties="clr-namespace:AutomationMLMapper.Properties" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
   
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/AutomationMLMapper;component/StyleResources/ListStyle.xaml"/>
                <ResourceDictionary Source="/AutomationMLMapper;component/StyleResources/Templates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <ConvertersAndTemplateSelectors:BoolToVisibilityConverter FalseValue="Collapsed" x:Key="btvc" />
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid Background="Transparent">   
         
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30*"></ColumnDefinition>
            <ColumnDefinition Width="30*"></ColumnDefinition>
            <ColumnDefinition Width="30*"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <StackPanel Height="24" Grid.Row="0" Grid.ColumnSpan="3" Orientation="Horizontal">
            <Image Margin="5,0,0,0" Source="{MarkupExtensions:ImageResolution Source=RCLib.ico,Size=24}"></Image>
            <TextBlock Margin="5,0,0,0" VerticalAlignment="Center">
                <Run Text="RoleClass Library: "></Run>
                <Run Text="{Binding CollectionOwner.Name}"></Run>
            </TextBlock>
        </StackPanel>
        
        <ListView Grid.Row="1" IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch"
			 Name="ListOfChangedRoles" Grid.Column="0"
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                  ScrollViewer.IsDeferredScrollingEnabled="True"
			      ItemsSource="{Binding ChangedRolesCollection.View}" Margin="0,2,0,0" >

            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" CellTemplate="{StaticResource NameOutputTemplateWithChangeToolTip}" 
                                    HeaderContainerStyle="{StaticResource ColumnHeaderStyle}">
                        <GridViewColumn.HeaderTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{MarkupExtensions:ImageResolution Source=RC.ico, Size=24}"></Image>
                                    <TextBlock Margin="5,0,0,0" Text="Changed RoleClass"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.HeaderTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>

        <ListView Grid.Row="1" IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch"
			 Name="ListOfMissingRoles" Grid.Column="1"
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                  ScrollViewer.IsDeferredScrollingEnabled="True"
			      ItemsSource="{Binding MissingRolesCollection.View}" Margin="0,2,0,0" >

            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" CellTemplate="{StaticResource NameOutputTemplate}" 
                                    HeaderContainerStyle="{StaticResource ColumnHeaderStyle}">
                        <GridViewColumn.HeaderTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{MarkupExtensions:ImageResolution Source=RC.ico, Size=24}"></Image>
                                    <TextBlock Margin="5,0,0,0" Text="Missing RoleClass"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.HeaderTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>

        <ListView Grid.Row="1" IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch"
			 Name="ListOfAddedRoles" Grid.Column="2"
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling"
                  ScrollViewer.IsDeferredScrollingEnabled="True"
			      ItemsSource="{Binding AddedRolesCollection.View}" Margin="0,2,0,0" >

            <ListView.View>
                <GridView>
                    <GridViewColumn Width="Auto" CellTemplate="{StaticResource NameOutputTemplate}" 
                                    HeaderContainerStyle="{StaticResource ColumnHeaderStyle}">
                        <GridViewColumn.HeaderTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{MarkupExtensions:ImageResolution Source=RC.ico, Size=24}"></Image>
                                    <TextBlock Margin="5,0,0,0" Text="Added RoleClass"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.HeaderTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        
    </Grid>
</UserControl>
